/************************************************************
   Copyright 2008 Abhinav Pobbati

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*************************************************************/

#pragma once

#include "Havok4Xna/Physics/Collide/HkpCollide.h"
#include "Havok4Xna/Physics/Collide/Agent/HkpAgent.h"
#include "Havok4Xna/Physics/Internal/HkpInternal.h"

#pragma unmanaged
#include <Physics/Collide/Dispatch/hkpAgentRegisterUtil.h>
#include <Physics/Collide/Dispatch/BroadPhase/hkpBroadPhaseListener.h>
#include <Physics/Collide/Dispatch/hkpCollisionDispatcher.h>
#include <Physics/Collide/Dispatch/ContactMgr/hkpContactMgrFactory.h>
#include <Physics/Collide/Dispatch/BroadPhase/hkpNullBroadPhaseListener.h>
#include <Physics/Collide/Dispatch/ContactMgr/hkpNullContactMgr.h>
#include <Physics/Collide/Dispatch/ContactMgr/hkpNullContactMgrFactory.h>
#include <Physics/Collide/Dispatch/BroadPhase/hkpTypedBroadPhaseHandle.h>
#include <Physics/Collide/Dispatch/BroadPhase/hkpTypedBroadPhaseHandlePair.h>
#pragma managed

namespace Havok4Xna {
	namespace Physics {
		namespace Internal {
			ref class HkpBroadPhaseHandle;
		}
	}
}

using namespace Havok4Xna::Physics::Internal;

namespace Havok4Xna {
	namespace Physics {
		namespace Collide {
			ref class HkpTypedBroadPhaseHandlePair;

			public interface class HkpBroadPhaseListener : public INativeReference {
				void AddCollisionPair(HkpTypedBroadPhaseHandlePair ^pair);
				void RemoveCollisionPair(HkpTypedBroadPhaseHandlePair ^pair);
			};

			public ref class HkpCollisionDispatcher : public INativeReference {
			public:
				ref class Agent3Funcs : public INativeReference {
				internal:
					HK_CLASS_INTERNALS(Agent3Funcs, hkpCollisionDispatcher::Agent3Funcs)
				};
				ref class AgentFuncs : public INativeReference {
				internal:
					HK_CLASS_INTERNALS(AgentFuncs, hkpCollisionDispatcher::AgentFuncs)
				};
				enum class CollisionQualityLevel : int {
					Invalid = hkpCollisionDispatcher::COLLISION_QUALITY_INVALID,
					PSI = hkpCollisionDispatcher::COLLISION_QUALITY_PSI,
					TOI = hkpCollisionDispatcher::COLLISION_QUALITY_TOI,
					TOIHigher = hkpCollisionDispatcher::COLLISION_QUALITY_TOI_HIGHER,
					TOIForced = hkpCollisionDispatcher::COLLISION_QUALITY_TOI_FORCED,
					Character = hkpCollisionDispatcher::COLLISION_QUALITY_CHARACTER,
					TMPExpandManifold = hkpCollisionDispatcher::COLLISION_QUALITY_TMP_EXPAND_MANIFOLD
				};

			internal:
				HK_CLASS_INTERNALS(HkpCollisionDispatcher, hkpCollisionDispatcher)
			};

			public ref class HkpContactMgrFactory : public INativeReference {
			internal:
				HK_CLASS_INTERNALS(HkpContactMgrFactory, hkpContactMgrFactory)
			};

			public ref class HkpNullBroadPhaseListener : public INativeReference /*REPLACE WITH: public HkpBroadPhaseListener*/ {
			internal:
				HK_CLASS_INTERNALS(HkpNullBroadPhaseListener, hkpNullBroadPhaseListener)
			};

			public ref class HkpNullContactMgr : public HkpContactMgr {
			internal:
				HK_DERIVED_CLASS_INTERNALS(HkpNullContactMgr, hkpNullContactMgr, HkpContactMgr)
			};

			public ref class HkpNullContactMgrFactory : public HkpContactMgrFactory {
			internal:
				HK_DERIVED_CLASS_INTERNALS(HkpNullContactMgrFactory, hkpNullContactMgrFactory, HkpContactMgrFactory)
			};

			public ref class HkpTypedBroadPhaseHandle : public HkpBroadPhaseHandle {
			internal:
				HK_DERIVED_CLASS_INTERNALS(HkpTypedBroadPhaseHandle, hkpTypedBroadPhaseHandle, HkpBroadPhaseHandle)
			};

			public ref class HkpTypedBroadPhaseHandlePair : public HkpBroadPhaseHandlePair {
			internal:
				HK_DERIVED_CLASS_INTERNALS(HkpTypedBroadPhaseHandlePair, hkpTypedBroadPhaseHandlePair, HkpBroadPhaseHandlePair)
			};
		}
	}
}
